home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra / helpful.zip / tips < prev    next >
Text File  |  1995-08-21  |  7KB  |  267 lines

  1.   The Linux Tips HOWTO
  2.   Vince Reed, reedv@rpi.edu
  3.   v0.1, 30 August 1994
  4.  
  5.   This document describes time-saving ideas and procedures intended to
  6.   make linux easier to configure and use. Items found here are too gen-
  7.   eral to be included in one of the other howtos.
  8.  
  9.   1.  Introduction
  10.  
  11.   Welcome to the Linux Tips HOWTO, a place to find swift answers to
  12.   questions not covered in the more specific linux howtos. In the tips
  13.   howto, you'll also find neat little tricks that make managing and
  14.   using Linux systems easier. However, as this is only the second
  15.   release of the tips howto, the number of tips mentioned is still
  16.   rather small. The next issue needn't be this way though... Please send
  17.   me your ideas to be included in future howtos. Thanks in advance!
  18.  
  19.   Vince Reed Maintainer--Linux TIPS HOWTO
  20.  
  21.   reedv@rpi.edu
  22.  
  23.   2.  Short Tips
  24.  
  25.   2.1.  Moving directories between filesystems. Alan Cox,
  26.   A.Cox@swansea.ac.uk
  27.  
  28.   Quick way to move an entire tree of files from one disk to another
  29.  
  30.  
  31.        (cd /source/directory; tar cf - . ) | (cd /dest/directory; tar xvfp -)
  32.  
  33.  
  34.  
  35.  
  36.  
  37.   2.2.  Ted Stern, stern@amath.washington.edu Pointer to patch for GNU
  38.   Make 3.70 to change VPATH behavior.
  39.  
  40.   I don't know if many people have this problem, but there is a
  41.   "feature" of GNU make version 3.70 that I don't like. It is that VPATH
  42.   acts funny if you give it an absolute pathname.  There is an extremely
  43.   solid patch that fixes this, which you can get from Paul D. Smith
  44.   <psmith@wellfleet.com>.  He also posts the documentation and patch
  45.   after every revision of GNU make on the newsgroup system I have access
  46.   to.
  47.  
  48.  
  49.   2.3.  How do I stop my system from fscking on each reboot? Dale Lutz,
  50.   dal@wimsey.com
  51.  
  52.   Q:  How do I stop e2fsck from checking my disk every time I boot up.
  53.  
  54.   A:  When you rebuild the kernel, the filesystem is marked as 'dirty'
  55.   and so your disk will be checked with each boot.  The fix is to run:
  56.  
  57.   rdev -R /zImage 1
  58.  
  59.   This fixes the kernel so that it is no longer convinced that the
  60.   filesystem is dirty.
  61.  
  62.   Note: If using lilo, then add read-only to your linux setup in your
  63.   lilo config file (Usually /etc/lilo.conf)
  64.  
  65.  
  66.  
  67.   2.4.  How to avoid fscks caused by "device busy" at reboot time. Jon
  68.   Tombs, jon@gtex02.us.es
  69.  
  70.   If you often get device busy errors on shutdown that leave the
  71.   filesystem in need of an fsck upon reboot, here is a simple fix:
  72.  
  73.   To /etc/brc or /sbin/brc, add the line
  74.  
  75.  
  76.        mount -o remount,ro /mount.dir
  77.  
  78.  
  79.  
  80.  
  81.   for all your mounted filesystems except /, before the call to umount
  82.   -a. This means if, for some reason, shutdown fails to kill all pro-
  83.   cesses and umount the disks they will still be clean on reboot. Saves
  84.   a lot of time at reboot for me
  85.  
  86.  
  87.  
  88.  
  89.   2.5.  How to print pages with a margin for hole punching. Mike Dickey,
  90.   mdickey@thorplus.lib.purdue.edu
  91.  
  92.  
  93.  
  94.        ______________________________________________________________________
  95.                #!/bin/sh
  96.                # /usr/local/bin/print
  97.                # a simple formatted printout, to enable someone to
  98.                # 3-hole punch the output and put it in a binder
  99.  
  100.                cat $1 | pr -t -o 5 -w 85 | lpr
  101.        ______________________________________________________________________
  102.  
  103.  
  104.  
  105.  
  106.  
  107.   2.6.  Raul Deluth Miller, rockwell@nova.umd.edu A way to search
  108.   through trees of files for a particular regular expression.
  109.  
  110.   I call this script 'forall'.  Use it like this:
  111.  
  112.  
  113.        forall /usr/include grep -i ioctl
  114.        forall /usr/man grep ioctl
  115.  
  116.  
  117.  
  118.  
  119.   Here's forall:
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.   ______________________________________________________________________
  134.   #!/bin/sh
  135.   if [ 1 = `expr 2 \> $#` ]
  136.   then
  137.           echo Usage: $0 dir cmd [optargs]
  138.           exit 1
  139.   fi
  140.   dir=$1
  141.   shift
  142.   find $dir -type f -print | xargs "$@"
  143.   ______________________________________________________________________
  144.  
  145.  
  146.  
  147.  
  148.  
  149.   2.7.  Barry Tolnas, tolnas@nestor.engr.utk.edu A script for cleaning
  150.   up after programs that creat autosave and backup files.
  151.  
  152.   Here is a simple two-liner which recursively descends a directory
  153.   hierarchy removing emacs auto-save ( ) and backup (#) files, .o files,
  154.   and  TeX .log files. It also compresses .tex files and README files. I
  155.   call it 'squeeze' on my system.
  156.  
  157.  
  158.        ______________________________________________________________________
  159.        #!/bin/sh
  160.        #SQUEEZE removes unnecessary files and compresses .tex and README files
  161.        #By Barry tolnas, tolnas@sun1.engr.utk.edu
  162.        #
  163.        echo squeezing $PWD
  164.        find  $PWD \( -name \*~ -or -name \*.o -or -name \*.log -or -name \*\#\) -exec
  165.        rm -f {} \;
  166.        find $PWD \( -name \*.tex -or -name \*README\* -or -name \*readme\* \) -exec gzip -9 {} \;
  167.        ______________________________________________________________________
  168.  
  169.  
  170.  
  171.  
  172.  
  173.   3.  Detailed Tips
  174.  
  175.   3.1.  Sharing swap partitions between Linux and Windows. Tony Acero,
  176.   ace3@midway.uchicago.edu
  177.  
  178.  
  179.   1. Format the partition as a dos partition, and create the Windows
  180.      swap file on it, but don't run windows yet. (You want to keep the
  181.      swap file completely empty for now, so that it compresses well).
  182.  
  183.   2. Boot linux and save the partition into a file.  For example if the
  184.      partition was /dev/hda8:
  185.  
  186.  
  187.        dd if=/dev/hda8 of=/etc/dosswap
  188.  
  189.  
  190.  
  191.  
  192.   3. Compress the dosswap file; since it is virtually all 0's it will
  193.      compress very well
  194.  
  195.  
  196.        gzip -9 /etc/dosswap
  197.  
  198.  
  199.   4. Add the following to the /etc/rc file to prepare and install the
  200.      swap space under Linux:
  201.  
  202.      XXXXX is the number of blocks in the swap partition
  203.  
  204.  
  205.        mkswap /dev/hda8 XXXXX
  206.        swapon -av
  207.  
  208.  
  209.  
  210.  
  211.   Make sure you add an entry for the swap partition in your /etc/fstab
  212.   file
  213.  
  214.   5. If your init/reboot package supports /etc/brc or /sbin/brc add the
  215.      following to /etc/brc, else do this by hand when you want to boot
  216.      to dos|os/2 and you want to convert the swap partition back to the
  217.      dos/windows version:
  218.  
  219.  
  220.  
  221.        swapoff -av
  222.        zcat /etc/dosswap.gz | dd of=/dev/hda8 bs=1k count=100
  223.  
  224.  
  225.  
  226.  
  227.   # Note that this only writes the first 100 blocks back to the parti-
  228.   tion. I've found empirically that this is sufficient
  229.  
  230.   >>  What are the pros and cons of doing this?
  231.  
  232.   Pros: you save a substantial amount of disk space.
  233.  
  234.   Cons: if step 5 is not automatic, you have to remember to do it by
  235.   hand, and it slows the reboot process by a nanosecond :-)
  236.  
  237.  
  238.  
  239.   3.2.  How to configure xdm's chooser for host selection. Arrigo Tri-
  240.   ulzi, a.triulzi@ic.ac.uk
  241.  
  242.  
  243.   1. Edit the file that launches xdm most likely /etc/rc/rc.6 or
  244.      /etc/rc.local) so that it contains the following lines in the xdm
  245.      startup section.
  246.  
  247.  
  248.  
  249.        /usr/bin/X11/xdm
  250.        exec /usr/bin/X11/X -indirect hostname
  251.  
  252.  
  253.  
  254.  
  255.   2. Edit /usr/lib/X11/xdm/Xservers and comment out the line which
  256.      starts the server on the local machine i.e. starting 0:
  257.  
  258.   3. Reboot the machine and you're home and away.
  259.  
  260.   I add this because when I was, desperately, trying to set it up for my
  261.   own subnet over here it took me about a week to suss out all the
  262.   problems.
  263.  
  264.  
  265.   Caveat: with old SLS (1.1.1) for some reason you can leave a -nodaemon
  266.   after the xdm line -- this does NOT work for later releases.
  267.